package com.xhu.water_supply.service;

import com.xhu.water_supply.entity.Administrator;
import com.xhu.water_supply.entity.Customer;
import com.xhu.water_supply.mapper.CustomerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    public List<Customer> findAll() {
        return customerMapper.findAll();
    }

    public List<Customer> selectCustomer(String cname) {
        return customerMapper.selectCustomer(cname);
    }

    public int addCustomer(Customer customer) {
        return customerMapper.addCustomer(customer);
    }

    public Customer getById(String cid){
        return customerMapper.getById(cid);
    }

    public int editCustomer(Customer customer) {
        return customerMapper.editCustomer(customer);
    }

    public int delCustomer(int cid) {
        return customerMapper.delCustomer(cid);
    }

    public List<Customer> queryPage(Integer starRows){
        return customerMapper.queryPage(starRows);
    }

    public int getRowCount(){
        return customerMapper.getRowCount();
    }

}